package red.service.impl;

import red.dao.UserDao;
import red.dao.impl.UserDaoImpl;
import red.model.UserModel;
import red.service.UserService;

import red.util.Model;


import java.util.List;
import java.util.UUID;

public class UserServiceImpl implements UserService {
    private UserDao userDao=new UserDaoImpl();
    @Override
    public UserModel addUser(Model model) {
        String user_name=(String) model.get("user_name");
        String password=(String) model.get("password");
        UserModel userModel=new UserModel();
        userModel.setUser_name(user_name);
        userModel.setPassword(password);
        userModel.setUser_id(UUID.randomUUID().toString());
        return userDao.savaUser(userModel);
    }

    @Override
    public List<UserModel> getuser() { return null; }
}
